home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 November: Tool Chest / Dev.CD Nov 94.toast / Sample Code / RAMDisk sample / Read Me < prev    next >
Encoding:
Text File  |  1994-08-31  |  2.9 KB  |  61 lines  |  [TEXT/MPS ]

  1. DTS sample RAM disk.  Originally by Gordon Sheridan.  Updated by Jim Luther.
  2. Metrowerks conversion by Brian Bechtel, DTS 940519 at the WWDC (Thanks to
  3. the Metrowerks coding lab.)
  4.  
  5. This sample is a control panel, which installs a RAM disk. Under Metrowerks
  6. and Symantec, this sample is completely in C.
  7.  
  8. How I converted this program from MPW to Metrowerks.
  9.  
  10. • Added a main() routine to the driver to handle Metrowerks' startup code.
  11. • Cleaned up various errors or warnings where Metrowerks was tighter than 
  12.   MPW or Symantec.
  13. • Created a project file for the control panel.  This project creates a
  14.   code resource of type cdev, id -4064, which is a control panel.  This
  15.   project file is '3RamCDEV.µ'.
  16. • I built the resource file, and named it '3RamCDEV.µ.rsrc'.  This ensures
  17.   that the resources will be automatically included when you build the
  18.   control panel.
  19. • Created a project file for the DRVR.  This project is a code resource
  20.   of type DRVR, id 48, which is the driver itself.  Set the project so
  21.   that the DRVR resource is merged into '3RamCDEV.µ.rsrc'.
  22. • Created a project file for the INIT.  This project is a code resource
  23.   of type INIT, id 0, which will install the driver.  Set the project so
  24.   that the INIT resource is merged into '3RamCDEV.µ.rsrc'.
  25. • I had to change the code slightly, because this driver was using some
  26.   low memory globals directly.  I now handle low memory accesses by using
  27.   accessor functions.  There was one problem; UnitNTryCnt was not defined.
  28.   I created my own accessor functions for this low memory global.  This is
  29.   fixed in the Universal Headers starting with ETO 15.
  30. • Recalculate BufPtr from the low memory global.
  31.  
  32. There is no way to set the driver flags in the driver header.  You have to either
  33. use ResEdit to change them to the desired values, or set them explicitly in the
  34. driver.  This sample driver sets the flags directly, in the DRVROpen() routine.
  35.  
  36. Build Order
  37.  
  38. The control panel consists of four parts: various resources needed to run, plus
  39. an 'INIT' to load the driver, a 'DRVR' which is the driver itself, and a 'cdev' 
  40. which is the user interface for setting up the driver.
  41.  
  42. If you are using the .r file, use MPW or SARez to build the resource file
  43. RamCDev.µ.rsrc.  All three projects assume the existence of 3RamCDev.µ.rsrc
  44.  
  45. Build the project 1RamINIT.µ.  This will add an 'INIT' resource to 3RamCDev.µ.rsrc.
  46.  
  47. Build the project 2RamDRVR.µ.  This will add a 'DRVR' resource to 3RamCDev.µ.rsrc.
  48.  
  49. Build the project 3RamCDEV.µ.  This will create a control panel containing the
  50. 'INIT', 'DRVR', and 'cdev' resources necessary to run this control panel.
  51.  
  52. You can use the AppleScript provided to build either the Metrowerks or Symantec
  53. versions of this RAMDisk.
  54.  
  55. Known errors in Metrowerks:
  56.  
  57. MW C/C++ 68K 1.0 & earlier: The driver name ".RamDRVR" is put into the driver as
  58. {09}{00}.RamDRVR.  I had to change this to {08}.RamDRVR{00} to be correct.  This
  59. is what it should have generated.  Use ResEdit. This is fixed in MW C/C++ 68K
  60. 1.0.1.
  61.